package cn.com.b2office.service.impl;

import java.util.Date;
import java.util.List;

import cn.com.b2office.dao.ItemCommentDao;
import cn.com.b2office.domain.ItemComment;
import cn.com.b2office.service.ItemCommentService;

public class ItemCommentServiceImpl implements ItemCommentService {

	private ItemCommentDao itemCommentDao = null;

	public void setItemCommentDao(ItemCommentDao itemCommentDao) {
		this.itemCommentDao = itemCommentDao;
	}

	public void commetItem(ItemComment cmm) {
		Date cur = new Date();
		cmm.setCmmtime(cur);
		cmm.setModifytime(cur);
		itemCommentDao.addComment(cmm);
	}

	public List<ItemComment> findComments(String itemId, int firstResult,
			int maxResults) {
		return itemCommentDao.findComments(itemId, firstResult, maxResults);
	}

	public int getCommentSize(String itemId) {
		return itemCommentDao.getCommentSize(itemId);
	}

}
